/****** Object:  Stored Procedure dbo.spr_UpdateDBCompaniesByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateDBCompaniesByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateDBCompaniesByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateDBCompaniesByPK]
 (
	@address varchar(50),
	@compid int,
	@compname varchar(50),
	@comptitle varchar(50),
	@contactnos varchar(50),
	@contactperson varchar(50),
	@dealexpirydate datetime,
	@dealstartdate datetime,
	@isactive bit,
	@remarks varchar(100)
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [Companies]
	SET
		[Address] = @address,
		[CompId] = @compid,
		[CompName] = @compname,
		[CompTitle] = @comptitle,
		[ContactNos] = @contactnos,
		[ContactPerson] = @contactperson,
		[DealExpiryDate] = @dealexpirydate,
		[DealStartDate] = @dealstartdate,
		[IsActive] = @isactive,
		[Remarks] = @remarks

	WHERE
	[CompId] = @compid


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

